import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class AppTextField extends StatelessWidget {
    const AppTextField(
      { super.key,
    this.style,
    this.hintText,
    this.hintStyle,
    this.focusNode,
    this.controller,
    this.keyboardType,
    this.maxLines = 1,
    this.inputFormatters,
    this.readOnly = false,
    this.autofocus = false,
    this.obscureText = false,
    this.textAlign = TextAlign.start,
    this.contentPadding = EdgeInsets.zero,
    this.textInputAction,
    this.onTap,
    this.onSubmitted,});


  final String? hintText;
  final TextStyle? style;
  final TextStyle? hintStyle;
  final EdgeInsetsGeometry contentPadding;

  final int? maxLines;
  final bool readOnly;
  final bool autofocus;
  final bool obscureText;
  final TextAlign textAlign;
  final FocusNode? focusNode;
  final TextInputType? keyboardType;
  final TextEditingController? controller;
  final List<TextInputFormatter>? inputFormatters;
  final TextInputAction? textInputAction;
  final VoidCallback? onTap;
  final Function(String)? onSubmitted;
  
  @override
  Widget build(BuildContext context) {
    return TextField(
      cursorColor: const Color(0xFFF80002),
      readOnly: readOnly,
      maxLines: maxLines,
      autofocus: autofocus,
      focusNode: focusNode,
      controller: controller,
      keyboardType: keyboardType,
      inputFormatters: inputFormatters,
      style: style,
      textAlign: textAlign,
      obscureText: obscureText,
      decoration: InputDecoration(
        isDense: true,
        hintText: hintText, 
        border:InputBorder.none,
        hintStyle:hintStyle,
        contentPadding: contentPadding,
      ),
      textInputAction: textInputAction,
      onTap: onTap,
      onSubmitted: onSubmitted,
    );
  }


}
